package cn.gztang.entity.dto;

import cn.gztang.util.JsoupUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * @author GaoFeng2017
 * @date 2018/9/9 19:12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserPasswordUpdate {
    @NotBlank
    @Length(min = 5, max = 20)
    private String account;

    @NotBlank
    @Length(min = 8, max = 20)
    private String oldPassword;

    @NotBlank
    @Length(min = 8, max = 20)
    private String newPassword;

    public String getAccount() {
        return JsoupUtil.getSafeHtml(account);
    }


    public String getOldPassword() {
        return JsoupUtil.getSafeHtml(oldPassword);
    }


    public String getNewPassword() {
        return JsoupUtil.getSafeHtml(newPassword);
    }

}
